#ifndef REPORTWEATHER_H
#define REPORTWEATHER_H

#include <QLabel>
#include <QMenu>
#include <QNetworkReply>
#include <QWidget>
#include "citycodeutils.h"
#include "day.h"
#include <QJsonDocument>

namespace Ui {
class reportWeather;
}

class reportWeather : public QWidget
{
    Q_OBJECT

public:
    explicit reportWeather(QWidget *parent = nullptr);
    ~reportWeather();
    Day days[7];
    QList<QLabel *> mDateList;
    QList<QLabel *> mWeekList;
    QList<QLabel *> mIconList;
    QList<QLabel *> mWeaTypeList;
    QList<QLabel *> mAirqList;
    QList<QLabel *> mFxList;
    QList<QLabel *> mFlList;
    void parseJsonDocument(QByteArray byteArray);
    void parseWeatherJsonDataNew(QByteArray byteArray);
    void updateUI();
    void drawTempLineHigh();
    void drawTempLineLow();
    void mouseMoveEvent(QMouseEvent *e);//鼠标移动
    void mousePressEvent(QMouseEvent *e);//鼠标按下移动
public slots:
    void finishedSlot(QNetworkReply *reply);
private slots:
    void on_pushButton_clicked();

    void on_toolButton_clicked();

    void on_toolButton_2_clicked();

    void on_toolButton_3_clicked();

private:
    Ui::reportWeather *ui;
    QMenu *menuQuit;
    QPoint mOffset;
    QNetworkReply *reply;
    QString strUrl;
    QNetworkAccessManager *manager;
    CityCodeUtils cityCodeUtils;
    QMap<QString,QString> mTypeMap;
    QJsonDocument  pJsonDocument;
    QPoint p;
};

#endif // REPORTWEATHER_H
